<?php 
include("conn.php");

$aid=$_GET['aid'];
$num=array();

if(!isset($aid)||!is_numeric($aid)){
	$num['click']=80;
}else{
$db=db_connect();
$sql="UPDATE `".PRETABLE."arcmain` SET `click`=`click`+1 WHERE `id`='".$aid."'";
$db->query($sql) or die($num['click']=88);

$sql="SELECT `click` FROM `".PRETABLE."arcmain` WHERE `id`='".$aid."'";
$rs=$db->query($sql) or die($num['click']=89);
$num=$rs->fetch_assoc();
}
echo "document.write(\"".$num['click']."\");\r\n";
?>